


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="htmlId">
<head>
  <title>Coverage Report :: EntityPersisterConfiguration</title>
  <style type="text/css">
    @import "../../.css/coverage.css";
  </style>
</head>

<body>
<div class="header"></div>

<div class="content">
<div class="breadCrumbs">
    [ <a href="../../index.html">all classes</a> ]
    [ <a href="../index.html">at.dormancy</a> ]
</div>

<h1>Coverage Summary for Class: EntityPersisterConfiguration (at.dormancy)</h1>

<table class="coverageStats">
<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Class, %
</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">EntityPersisterConfiguration</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (1/ 1)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (12/ 12)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (25/ 25)
  </span>
</td>
</tr>

</table>

<br/>
<br/>


<div class="sourceCode"><i>1</i>&nbsp;/*
<i>2</i>&nbsp; * Copyright 2013 Gregor Schauer
<i>3</i>&nbsp; *
<i>4</i>&nbsp; * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<i>5</i>&nbsp; * you may not use this file except in compliance with the License.
<i>6</i>&nbsp; * You may obtain a copy of the License at
<i>7</i>&nbsp; *
<i>8</i>&nbsp; *      http://www.apache.org/licenses/LICENSE-2.0
<i>9</i>&nbsp; *
<i>10</i>&nbsp; * Unless required by applicable law or agreed to in writing, software
<i>11</i>&nbsp; * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
<i>12</i>&nbsp; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<i>13</i>&nbsp; * See the License for the specific language governing permissions and
<i>14</i>&nbsp; * limitations under the License.
<i>15</i>&nbsp; */
<i>16</i>&nbsp;package at.dormancy;
<i>17</i>&nbsp;
<i>18</i>&nbsp;import javax.annotation.Nonnull;
<i>19</i>&nbsp;import javax.annotation.Nullable;
<i>20</i>&nbsp;
<i>21</i>&nbsp;/**
<i>22</i>&nbsp; * The configuration for {@link at.dormancy.persister.EntityPersister}s.
<i>23</i>&nbsp; *
<i>24</i>&nbsp; * @author Gregor Schauer
<i>25</i>&nbsp; */
<i>26</i>&nbsp;public class EntityPersisterConfiguration {
<i>27</i>&nbsp;	/**
<i>28</i>&nbsp;	 * Enables saving of new Hibernate entities without identifier
<i>29</i>&nbsp;	 */
<i>30</i>&nbsp;	private Boolean saveNewEntities;
<i>31</i>&nbsp;	/**
<i>32</i>&nbsp;	 * Enables version checking for Hibernate entities
<i>33</i>&nbsp;	 */
<i>34</i>&nbsp;	private Boolean checkVersion;
<i>35</i>&nbsp;	/**
<i>36</i>&nbsp;	 * Automatically flushes the current persistence context after cloning
<i>37</i>&nbsp;	 */
<i>38</i>&nbsp;	private Boolean flushAutomatically;
<i>39</i>&nbsp;	/**
<i>40</i>&nbsp;	 * Enables cloning of objects instead of modifying them
<i>41</i>&nbsp;	 */
<i>42</i>&nbsp;	private Boolean cloneObjects;
<i>43</i>&nbsp;	/**
<i>44</i>&nbsp;	 * Attempts to create empty collections/maps for uninitialized persistent collections
<i>45</i>&nbsp;	 */
<i>46</i>&nbsp;	private Boolean createEmptyCollections;
<i>47</i>&nbsp;	/**
<i>48</i>&nbsp;	 * The parent configuration
<i>49</i>&nbsp;	 */
<i>50</i>&nbsp;	private EntityPersisterConfiguration parent;
<i>51</i>&nbsp;
<b class="fc"><i>52</i>&nbsp;	public EntityPersisterConfiguration() {</b>
<b class="fc"><i>53</i>&nbsp;		saveNewEntities = false;</b>
<b class="fc"><i>54</i>&nbsp;		checkVersion = true;</b>
<b class="fc"><i>55</i>&nbsp;		flushAutomatically = false;</b>
<b class="fc"><i>56</i>&nbsp;		cloneObjects = false;</b>
<b class="fc"><i>57</i>&nbsp;		createEmptyCollections = true;</b>
<b class="fc"><i>58</i>&nbsp;	}</b>
<i>59</i>&nbsp;
<b class="fc"><i>60</i>&nbsp;	public EntityPersisterConfiguration(@Nonnull EntityPersisterConfiguration parent) {</b>
<b class="fc"><i>61</i>&nbsp;		this.parent = parent;</b>
<b class="fc"><i>62</i>&nbsp;	}</b>
<i>63</i>&nbsp;
<i>64</i>&nbsp;	/**
<i>65</i>&nbsp;	 * Returns whether new entities should be persisted automatically.
<i>66</i>&nbsp;	 * &lt;p/&gt;
<i>67</i>&nbsp;	 * &lt;p&gt;Default is {@code false}.&lt;/p&gt;
<i>68</i>&nbsp;	 *
<i>69</i>&nbsp;	 * @return {@code true} if new entities should be processed, {@code false} otherwise
<i>70</i>&nbsp;	 */
<i>71</i>&nbsp;	@Nonnull
<i>72</i>&nbsp;	public Boolean getSaveNewEntities() {
<b class="fc"><i>73</i>&nbsp;		return saveNewEntities == null ? parent.getSaveNewEntities() : saveNewEntities;</b>
<i>74</i>&nbsp;	}
<i>75</i>&nbsp;
<i>76</i>&nbsp;	/**
<i>77</i>&nbsp;	 * Sets whether new entities should be persisted automatically.
<i>78</i>&nbsp;	 *
<i>79</i>&nbsp;	 * @param saveNewEntities {@code true} if new entities should be processed, {@code false} otherwise
<i>80</i>&nbsp;	 */
<i>81</i>&nbsp;	public void setSaveNewEntities(@Nullable Boolean saveNewEntities) {
<b class="fc"><i>82</i>&nbsp;		this.saveNewEntities = saveNewEntities;</b>
<b class="fc"><i>83</i>&nbsp;	}</b>
<i>84</i>&nbsp;
<i>85</i>&nbsp;	/**
<i>86</i>&nbsp;	 * Returns whether a version check should be performed before processing the properties.
<i>87</i>&nbsp;	 * &lt;p/&gt;
<i>88</i>&nbsp;	 * &lt;p&gt;Default is {@code true}.&lt;/p&gt;
<i>89</i>&nbsp;	 *
<i>90</i>&nbsp;	 * @return {@code true} if a version checking is enabled, {@code false} otherwise
<i>91</i>&nbsp;	 */
<i>92</i>&nbsp;	@Nonnull
<i>93</i>&nbsp;	public Boolean getCheckVersion() {
<b class="fc"><i>94</i>&nbsp;		return checkVersion == null ? parent.getCheckVersion() : checkVersion;</b>
<i>95</i>&nbsp;	}
<i>96</i>&nbsp;
<i>97</i>&nbsp;	/**
<i>98</i>&nbsp;	 * Sets whether a version check should be performed before processing the properties.
<i>99</i>&nbsp;	 *
<i>100</i>&nbsp;	 * @param checkVersion {@code true} if a version checking is enabled, {@code false} otherwise
<i>101</i>&nbsp;	 */
<i>102</i>&nbsp;	public void setCheckVersion(@Nullable Boolean checkVersion) {
<b class="fc"><i>103</i>&nbsp;		this.checkVersion = checkVersion;</b>
<b class="fc"><i>104</i>&nbsp;	}</b>
<i>105</i>&nbsp;
<i>106</i>&nbsp;	/**
<i>107</i>&nbsp;	 * Returns whether automatic flushing is done upon cloning objects.
<i>108</i>&nbsp;	 * &lt;p/&gt;
<i>109</i>&nbsp;	 * &lt;p&gt;Default is {@code false}.&lt;/p&gt;
<i>110</i>&nbsp;	 *
<i>111</i>&nbsp;	 * @return {@code true} if automatic flushing is enabled, {@code false} otherwise
<i>112</i>&nbsp;	 */
<i>113</i>&nbsp;	@Nonnull
<i>114</i>&nbsp;	public Boolean getFlushAutomatically() {
<b class="fc"><i>115</i>&nbsp;		return flushAutomatically == null ? parent.getFlushAutomatically() : flushAutomatically;</b>
<i>116</i>&nbsp;	}
<i>117</i>&nbsp;
<i>118</i>&nbsp;	/**
<i>119</i>&nbsp;	 * Sets whether automatic flushing should be done upon cloning objects.
<i>120</i>&nbsp;	 *
<i>121</i>&nbsp;	 * @param flushAutomatically {@code true} if automatic flushing should be enabled, {@code false} otherwise
<i>122</i>&nbsp;	 */
<i>123</i>&nbsp;	public void setFlushAutomatically(@Nullable Boolean flushAutomatically) {
<b class="fc"><i>124</i>&nbsp;		this.flushAutomatically = flushAutomatically;</b>
<b class="fc"><i>125</i>&nbsp;	}</b>
<i>126</i>&nbsp;
<i>127</i>&nbsp;	/**
<i>128</i>&nbsp;	 * Returns whether objects are cloned instead of reused.
<i>129</i>&nbsp;	 * &lt;p/&gt;
<i>130</i>&nbsp;	 * &lt;p&gt;Default is {@code false}.&lt;/p&gt;
<i>131</i>&nbsp;	 *
<i>132</i>&nbsp;	 * @return {@code true} if cloning is enabled, {@code false} otherwise
<i>133</i>&nbsp;	 */
<i>134</i>&nbsp;	@Nonnull
<i>135</i>&nbsp;	public Boolean getCloneObjects() {
<b class="fc"><i>136</i>&nbsp;		return cloneObjects == null ? parent.getCloneObjects() : cloneObjects;</b>
<i>137</i>&nbsp;	}
<i>138</i>&nbsp;
<i>139</i>&nbsp;	/**
<i>140</i>&nbsp;	 * Sets whether objects should be cloned instead of reused.
<i>141</i>&nbsp;	 *
<i>142</i>&nbsp;	 * @param cloneObjects {@code true} if objects should be cloned, {@code false} otherwise
<i>143</i>&nbsp;	 */
<i>144</i>&nbsp;	public void setCloneObjects(@Nullable Boolean cloneObjects) {
<b class="fc"><i>145</i>&nbsp;		this.cloneObjects = cloneObjects;</b>
<b class="fc"><i>146</i>&nbsp;	}</b>
<i>147</i>&nbsp;
<i>148</i>&nbsp;	/**
<i>149</i>&nbsp;	 * Returns whether persistent collections are replaced with empty collections or maps or with {@code null}.
<i>150</i>&nbsp;	 *
<i>151</i>&nbsp;	 * @return {@code true} if empty collections should be created, {@code false} otherwise
<i>152</i>&nbsp;	 */
<i>153</i>&nbsp;	@Nonnull
<i>154</i>&nbsp;	public Boolean getCreateEmptyCollections() {
<b class="fc"><i>155</i>&nbsp;		return createEmptyCollections == null ? parent.getCreateEmptyCollections() : createEmptyCollections;</b>
<i>156</i>&nbsp;	}
<i>157</i>&nbsp;
<i>158</i>&nbsp;	/**
<i>159</i>&nbsp;	 * Sets whether persistent collections should be replaced with empty collections or maps or with {@code null}.
<i>160</i>&nbsp;	 *
<i>161</i>&nbsp;	 * @param createEmptyCollections {@code true} if empty collections should be created, {@code false} otherwise
<i>162</i>&nbsp;	 */
<i>163</i>&nbsp;	public void setCreateEmptyCollections(@Nullable Boolean createEmptyCollections) {
<b class="fc"><i>164</i>&nbsp;		this.createEmptyCollections = createEmptyCollections;</b>
<b class="fc"><i>165</i>&nbsp;	}</b>
<i>166</i>&nbsp;}
</div>
</div>

<div class="footer">
    
    <div style="float:right;">generated on 2013-07-31 23:31</div>
</div>
</body>
</html>
